<?php


/*
* Copyright (c) 2008-2016 vip.com, All Rights Reserved.
*
* Powered by com.vip.osp.osp-idlc-2.5.11.
*
*/

namespace com\vip\vis\order\jit\service\order;

class CreatePickParam {
	
	static $_TSPEC;
	public $vendor_id = null;
	public $po_no = null;
	public $warehouse = null;
	public $pick_flag = null;
	public $separate_priority_delivery = null;
	public $separate_quality_inspection = null;
	
	public function __construct($vals=null){
		
		if (!isset(self::$_TSPEC)){
			
			self::$_TSPEC = array(
			1 => array(
			'var' => 'vendor_id'
			),
			2 => array(
			'var' => 'po_no'
			),
			3 => array(
			'var' => 'warehouse'
			),
			4 => array(
			'var' => 'pick_flag'
			),
			5 => array(
			'var' => 'separate_priority_delivery'
			),
			6 => array(
			'var' => 'separate_quality_inspection'
			),
			
			);
			
		}
		
		if (is_array($vals)){
			
			
			if (isset($vals['vendor_id'])){
				
				$this->vendor_id = $vals['vendor_id'];
			}
			
			
			if (isset($vals['po_no'])){
				
				$this->po_no = $vals['po_no'];
			}
			
			
			if (isset($vals['warehouse'])){
				
				$this->warehouse = $vals['warehouse'];
			}
			
			
			if (isset($vals['pick_flag'])){
				
				$this->pick_flag = $vals['pick_flag'];
			}
			
			
			if (isset($vals['separate_priority_delivery'])){
				
				$this->separate_priority_delivery = $vals['separate_priority_delivery'];
			}
			
			
			if (isset($vals['separate_quality_inspection'])){
				
				$this->separate_quality_inspection = $vals['separate_quality_inspection'];
			}
			
			
		}
		
	}
	
	
	public function getName(){
		
		return 'CreatePickParam';
	}
	
	public function read($input){
		
		$input->readStructBegin();
		while(true){
			
			$schemeField = $input->readFieldBegin();
			if ($schemeField == null) break;
			$needSkip = true;
			
			
			if ("vendor_id" == $schemeField){
				
				$needSkip = false;
				$input->readI32($this->vendor_id); 
				
			}
			
			
			
			
			if ("po_no" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->po_no);
				
			}
			
			
			
			
			if ("warehouse" == $schemeField){
				
				$needSkip = false;
				$input->readString($this->warehouse);
				
			}
			
			
			
			
			if ("pick_flag" == $schemeField){
				
				$needSkip = false;
				$input->readI32($this->pick_flag); 
				
			}
			
			
			
			
			if ("separate_priority_delivery" == $schemeField){
				
				$needSkip = false;
				$input->readBool($this->separate_priority_delivery);
				
			}
			
			
			
			
			if ("separate_quality_inspection" == $schemeField){
				
				$needSkip = false;
				$input->readBool($this->separate_quality_inspection);
				
			}
			
			
			
			if($needSkip){
				
				\Osp\Protocol\ProtocolUtil::skip($input);
			}
			
			$input->readFieldEnd();
		}
		
		$input->readStructEnd();
		
		
		
	}
	
	public function write($output){
		
		$xfer = 0;
		$xfer += $output->writeStructBegin();
		
		if($this->vendor_id !== null) {
			
			$xfer += $output->writeFieldBegin('vendor_id');
			$xfer += $output->writeI32($this->vendor_id);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->po_no !== null) {
			
			$xfer += $output->writeFieldBegin('po_no');
			$xfer += $output->writeString($this->po_no);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->warehouse !== null) {
			
			$xfer += $output->writeFieldBegin('warehouse');
			$xfer += $output->writeString($this->warehouse);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->pick_flag !== null) {
			
			$xfer += $output->writeFieldBegin('pick_flag');
			$xfer += $output->writeI32($this->pick_flag);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->separate_priority_delivery !== null) {
			
			$xfer += $output->writeFieldBegin('separate_priority_delivery');
			$xfer += $output->writeBool($this->separate_priority_delivery);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		if($this->separate_quality_inspection !== null) {
			
			$xfer += $output->writeFieldBegin('separate_quality_inspection');
			$xfer += $output->writeBool($this->separate_quality_inspection);
			
			$xfer += $output->writeFieldEnd();
		}
		
		
		$xfer += $output->writeFieldStop();
		$xfer += $output->writeStructEnd();
		return $xfer;
	}
	
}

?>